@use "../_variables" as *;

.popup-confirm {
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--sd);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 400px;
  min-height: 200px;
  max-width: 95vw;
  max-height: 85vh;
  overflow: hidden;

  &.popup-confirm-top {
    .popup-confirm-header,
    .popup-confirm-content {
      padding-top: 36px;
    }
  }

  &.no-border {
    .popup-confirm-header,
    .popup-confirm-footer {
      border: none;
      background-color: transparent;
    }
  }

  > .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0px;
    right: 0px;

    &:hover {
      background: var(--bg-gray-medium);
    }
  }

  .popup-confirm-header {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--stroke-gray-medium);
    background-color: var(--bg-gray-medium);
    font-size: 16px;
    font-weight: 700;
  }

  .popup-confirm-content {
    padding: 16px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 0;
  }

  .popup-confirm-footer {
    flex-shrink: 0;
    padding: 20px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--stroke-gray-medium);

    &.space-between {
      justify-content: space-between;
    }

    &.center {
      justify-content: center;

      .popup-confirm-footer-btn {
        width: 100%;

        button {
          width: 100%;
        }
      }
    }
  }

  .popup-confirm-footer-hint {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .popup-confirm-footer-btn {
    display: flex;
    gap: 8px;
  }
}

.overlay {
  .popup-confirm {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: $breakpoint-xs;
    min-height: 0;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    top: 0;
    left: 0;
    transform: none;
    padding-top: $header-height;

    .popup-confirm-content {
      padding: 0;
    }

    .popup-confirm-footer {
      padding: 16px;
    }
  }
}